ASID: Optimize hvm_flush_guest_tlbs
authorKeir Fraser <keir@xen.org>
Fri, 7 Jan 2011 14:13:15 +0000 (14:13 +0000)
committerKeir Fraser <keir@xen.org>
Fri, 7 Jan 2011 14:13:15 +0000 (14:13 +0000)
commite8dea77d35136724a441bebd6892cf35a6f90420
tree035f348c49205ad94fa1578a536ed31907f80fe1
parent94feecc881658cb925ce2243ff0786a372d3d9fa
ASID: Optimize hvm_flush_guest_tlbs

In our testing, we found that function hvm_flush_guest_tlbs() is used
very frequently and it will always force asid recycling and will
result a whole tlb flush immediately no matter there are still free
asids or not.  Actually, in this case, just increasing core generation
might be enough and the remaining asids can still be used until
next_asid > max_asid.

Signed-off-by: Wei Wang <wei.wang2@amd.com>
Reviewed-by: Wei Huang <wei.huang2@amd.com>
Simplify the logic and also fix a very minor bug in
hvm_asid_handle_vmenter(), in the case that hvm_asid_flush_core() sets
data->disabled.

Signed-off-by: Keir Fraser <keir@xen.org>
xen/arch/x86/hvm/asid.c